const {
	list,
	rsp,
	parseData,
	paresPostData
} = require('../utils.js');
const Router = require('koa-router');
const router = new Router();
//====================================================================================
//====================================================================================


router.get('/get', (ctx, next) => {
	ctx.body = rsp({
		data: '这是get的返回',
		...ctx.request.query
	})
})

router.delete('/delete', (ctx, next) => {
	ctx.body = rsp({
		data: '这是delete的返回',
		...ctx.request.query
	})
})


router.put('/put', async (ctx, next) => {
	let param = await paresPostData(ctx);
	ctx.body = rsp({
		data: '这是put的返回',
		...param,
		...ctx.request.query
	})
})


router.post('/post', async (ctx, next) => {
	
	let param = await paresPostData(ctx);
	ctx.body = rsp({
		data: '这是post的返回',
		...param,
		...ctx.request.query
		
	})
})






module.exports = router.routes()
